package com.itheima.date;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class datetest02 {
    public static void main(String[] args) {
     String s="2020-11-11 13:14:15";
//       LocalDate localDate= LocalDate.now();
//        System.out.println(localDate);
//        LocalDate localDate1=LocalDate.of(2012,11,11);
//        System.out.println(localDate1);
//        LocalDateTime now=LocalDateTime.now();
//        System.out.println(now);
     DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
     LocalDateTime dateTime=LocalDateTime.of(2020,11,12,12,11,15);
     System.out.println(s);
     LocalDateTime parse = LocalDateTime.parse(s, pattern);
     System.out.println(parse);
     System.out.println(dateTime);
     System.out.println(dateTime.format(pattern));
//        System.out.println(dateTime.getYear());
//        System.out.println(dateTime.getMonthValue());
//        System.out.println(dateTime.getDayOfYear());
//        System.out.println(dateTime.getHour());
//        System.out.println(dateTime.getMinute());
//        System.out.println(dateTime.getSecond());
//        System.out.println(dateTime.toLocalDate());
//        System.out.println(dateTime.toLocalTime());
    }
}
